package rs.dalao.syc.user.pay.dao.persist.repository.impl;/*
 *   @author:Casin
 *   @date:2023/8/14
 *   @code:
 */

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import rs.dalao.syc.user.pay.dao.persist.mapper.OrderMapper;
import rs.dalao.syc.user.pay.dao.persist.repository.IOrderRepository;
import rs.dalao.syc.user.pay.pojo.entity.Prescription;

@Repository
public class OrderRepositoryImpl implements IOrderRepository {
    @Autowired
    private OrderMapper mapper;
    @Override
    public int updateState(String id) {
        Prescription prescription = new Prescription();
        prescription.setIsPaid(1); //修改状态为1

        QueryWrapper<Prescription> wrapper = new QueryWrapper<>();
        wrapper.eq("id", id); //更新条件

        return mapper.update(prescription, wrapper);
    }
}
